const { DataTypes } = require("sequelize");
const seq = require("../db/sequelize");
const Address = seq.define("address", {
  user_id: {
    type: DataTypes.INTEGER,
    primaryKey: false,
    comment: "所属用户ID",
  },
  consignee: {
    type: DataTypes.STRING,
    allowNull: false,
    comment: "收货人",
  },
  phone: {
    type: DataTypes.CHAR(11),
    allowNull: false,
    comment: "收货人联系方式",
  },
  address: {
    type: DataTypes.STRING(255),
    allowNull: false,
    comment: "收货人详细地址",
  },
  is_default: {
    type: DataTypes.BOOLEAN,
    defaultValue: false,
    comment: "是否为默认收货地址",
    allowNull: false,
  },
});
// Address.sync({ force: true });
module.exports = Address;
